home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / superdog.swf / scripts / DefineSprite_1252 / frame_2 / DoAction.as
Encoding:
Text File  |  2007-06-25  |  879 b   |  39 lines

  1. stop();
  2. onEnterFrame = function()
  3. {
  4.    if(_parent._parent.pauses == false)
  5.    {
  6.       getTime(45);
  7.       faces();
  8.       if(vars == false and Math.abs(_parent._parent.man._x - (this.getBounds(_parent._parent).xMin + this.getBounds(_parent._parent).xMax) / 2) <= 300 and Math.abs(_parent._parent.man._y - this.getBounds(_parent._parent).yMax) <= 100)
  9.       {
  10.          this.gotoAndPlay("attack");
  11.          vars = true;
  12.       }
  13.       if(dix == false)
  14.       {
  15.          this._x -= spd;
  16.          long += spd;
  17.          this._xscale = 100;
  18.       }
  19.       else
  20.       {
  21.          this._x += spd;
  22.          long += spd;
  23.          this._xscale = -100;
  24.       }
  25.       if(long >= 150)
  26.       {
  27.          long = 0;
  28.          if(dix == false)
  29.          {
  30.             dix = true;
  31.          }
  32.          else
  33.          {
  34.             dix = false;
  35.          }
  36.       }
  37.    }
  38. };
  39.